package cn.edu.hunau.basic.day02;

import org.junit.Test;

/**
 * @author hb
 * @date 2025-07-29 09:55:44
 */
public class DoubleTest {

    @Test
    public void test01(){
        float f=0.2F;
        int iMax=0x7fff_ffff;
        //浮点型可以进行四舍五入
        //整型赋值给浮点型可能存在精度的丢失
        float f1=iMax;
        System.out.println(iMax);
        System.out.println(f1);
    }

    @Test
    public void test02(){
        double d1=1.1d;
        double d2=1;
        double d3=d1 - d2;
        System.out.println(d3);//0.10000000000000009

    }

    @Test
    public void test03(){
        long  l1=123l;
        float f=l1;
        System.out.println(f);
    }

    @Test
    public void test04(){
         int a=128;
         byte b=(byte)a;
        System.out.println(b);//-128
    }
}
